package development.hdk.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper
{
  private static final String createMainTable = "CREATE TABLE mindmap (_id INTEGER PRIMARY KEY, treeName VARCHAR(100),icon VARCHAR(100),surfaceColor INTEGER);";
  private static final String createNodeTable = "CREATE TABLE nodes (_id INTEGER PRIMARY KEY, text VARCHAR(100), locationX REAL, locationY REAL, parentID INTEGER, backgroundColor INTEGER, borderColor INTEGER, iconDrawable VARCHAR(25), showIcon INTEGER, shape INTEGER, treeID INTEGER);";

  public DatabaseHelper(Context paramContext, String paramString, SQLiteDatabase.CursorFactory paramCursorFactory, int paramInt)
  {
    super(paramContext, paramString, paramCursorFactory, paramInt);
  }

  public void onCreate(SQLiteDatabase paramSQLiteDatabase)
  {
    paramSQLiteDatabase.execSQL("CREATE TABLE mindmap (_id INTEGER PRIMARY KEY, treeName VARCHAR(100),icon VARCHAR(100),surfaceColor INTEGER);");
    paramSQLiteDatabase.execSQL("CREATE TABLE nodes (_id INTEGER PRIMARY KEY, text VARCHAR(100), locationX REAL, locationY REAL, parentID INTEGER, backgroundColor INTEGER, borderColor INTEGER, iconDrawable VARCHAR(25), showIcon INTEGER, shape INTEGER, treeID INTEGER);");
  }

  public void onUpgrade(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2)
  {
    paramSQLiteDatabase.rawQuery("DROP TABLE mindmap;", null);
    paramSQLiteDatabase.rawQuery("DROP TABLE nodes;", null);
  }
}